package com.qf.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qf.dao.ResivewDao;
import com.qf.entity.TbResivew;
import com.qf.service.ResivewService;
import com.qf.utils.ResultMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName ResivewServiceImpl
 * @Description
 * @Author lanzhike
 * @Date 2023/7/19 16:38
 * @Version 1.0
 */
@Service
public class ResivewServiceImpl extends ServiceImpl<ResivewDao, TbResivew> implements ResivewService {
    @Autowired(required = false)
    ResivewDao resivewDao;
    @Override
    public ResultMsg addResivew(int studentId,int courseId,String resviewDesc) {
        int i = resivewDao.addResview(studentId, courseId, resviewDesc);
        if (i == 1)
            return ResultMsg.success();
        throw new RuntimeException("评论增改失败");
    }
}
